<template>
  <div class="main">
    <div class="main_box">
      <!-- 左 -->
      <div class="left">
        <div class="left-main-box">
          <!-- 轮播图 -->
          <Carousel></Carousel>
          <!-- 分类 -->
          <Sorti></Sorti>
          <!-- 文章 -->
          <Articlei></Articlei>
        </div>
        <!-- 右 -->
        <div class="register">
          <MyInfo></MyInfo>
          <Notice></Notice>
          <!-- <Rarticle></Rarticle> -->
          <Mydate></Mydate>
          <NewReply></NewReply>
          <Tags></Tags>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  //  左
  import Carousel from '@/components/left/Carousel.vue';
  import Sorti from '@/components/left/Sort.vue';
  import Articlei from '@/components/left/Articlei.vue';
  // 右
  import MyInfo from '@/components/register/MyInfo.vue';
  import Notice from '@/components/register/Notice.vue';
  import Rarticle from '@/components/register/Rarticle.vue';
  import Mydate from '@/components/register/Mydate.vue';
  import NewReply from '@/components/register/NewReply.vue';
  import Tags from '@/components/register/Tags.vue';

  export default {
    name: 'Main',
    data() {
      return {};
    },
    components: {
      Carousel,
      Sorti,
      Articlei,
      MyInfo,
      Notice,
      Rarticle,
      Mydate,
      NewReply,
      Tags,
    },
    methods: {
      // 获取 token
      getMyToken() {
        if (localStorage.getItem('token')) {
          this.$store.commit('getToken', localStorage.getItem('token'));
        } else {
          this.$store.commit('getToken', '');
        }
      },
    },
    created() {
      this.getMyToken();
    },
  };
</script>

<style lang="less" scoped>
  @import url('../state/mainPublic.less');
</style>
